from sklearn.tree import DecisionTreeClassifier
import numpy as np

# 创建数据
X = np.array([[1, 2], [2, 3], [3, 4], [4, 5]])
y = np.array([0, 0, 1, 1])

# 训练模型
model = DecisionTreeClassifier()
model.fit(X, y)

# 预测
print("Prediction for X=[2, 3]:", model.predict([[2, 3]]))